package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.example.model.User;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private UserService userService;
    @RequestMapping("/check")
    public Boolean login(String username, String password) {
        //进行校验身份
        log.info("进行登录");
        User user=userService.getUserByName(username,password);
        if(user==null) {
            return false;
        }
        return true;
    }
}
